home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / l2100.zip / CASTLE2.REF < prev    next >
Text File  |  1997-06-23  |  11KB  |  579 lines

  1. ;note to .ref masters:
  2. ;replace castle2 with something else to use this .ref for other dwellings
  3. ;this .ref uses no long term vars, instead it makes its own data file - this
  4. ;means upgrading the game will not make people 'lose ownership' of their
  5. ;stuff.
  6.  
  7. @#MYBANK
  8. ;team treasury
  9. @do moveback
  10. @do `p20 is 0
  11. @if tres2.dat exist true then do
  12.   @begin
  13.   @readfile tres2.dat
  14. `p20
  15.   @
  16.   @end
  17.  
  18. @clearblock 20 21
  19. @do move 3 21
  20. @do write
  21. `r0`2  Treasury is at `$$`p20`2 - (`0T`2)ake, (`0L`2)eave or (`0N`2)evermind? [`0N`2] :`%`x
  22. @do readspecial `s01 NTL
  23. @if `s01 is N then do
  24.  @begin
  25.  @do saybar
  26. You close the safe, carefully.
  27.  @closescript
  28.  @end
  29.  
  30. @if `s01 is T then do
  31.   @begin
  32.   @do move 5 23
  33.   @do write
  34. `0`r0Amount? `0: `%
  35.  @do readnum 10 0
  36.   @do `p21 is `v40
  37.   @if `p21 < 1 then `p21 is 0
  38.   @if `p21 > `p20 then do
  39.     @begin
  40.     @clearblock 21 24
  41.     @do saybar
  42. Not enough in here for that.
  43.     @closescript
  44.     @end
  45.  
  46.  @if `p21 is 0 then do
  47.    @begin
  48.     @clearblock 21 24
  49.     @do saybar
  50. You take nothing.
  51.     @closescript
  52.    @end
  53. //withdrawl.. we read from the file again so cheating won't be possible with
  54. //correct timing
  55.   @readfile tres2.dat
  56. `p20
  57.   @
  58.  
  59.   @if `p20 < `p21 then do
  60.     @begin
  61.     @clearblock 21 24
  62.     @do saybar
  63. Oh no!  Someone took the money while you were thinking about it!
  64.     @closescript
  65.     @end
  66.  
  67.     @do `p20 - `p21
  68.     @do money + `p21
  69.   @do delete tres2.dat
  70.   @writefile tres2.dat
  71. `p20
  72.   @
  73.     @clearblock 21 24
  74.     @do saybar
  75. `2You take `$`p21`2 from the treasury.
  76.  
  77. //if not owner, lets notify him
  78.  
  79. @readfile castle2.dat
  80. `p20
  81. `s01
  82. @
  83. ;load owner and current password
  84.  
  85. @if `p20 not &playernum then do
  86.   @begin
  87.    @writefile mail\mail`p20.dat
  88.   `0Castle Coldrake Reports:
  89. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  90. `0  `n`2 has taken `$$`p21 `2from the treasury.
  91.  
  92.   @end
  93.   @closescript
  94.   @end
  95.  
  96. @if `s01 is L then do
  97.   @begin
  98.   @do move 5 23
  99.   @do write
  100. `0`r0Amount? `0: `%
  101.  @do readnum 10 &money
  102.   @do `p21 is `v40
  103.   @if `p21 < 1 then `p21 is 0
  104.   @if `p21 > money then do
  105.     @begin
  106.     @clearblock 21 24
  107.     @do saybar
  108. You are not carrying that much!
  109.     @closescript
  110.     @end
  111.  
  112.  @if `p21 is 0 then do
  113.    @begin
  114.     @clearblock 21 24
  115.     @do saybar
  116. You decide to leave nothing.  Ha!
  117.     @closescript
  118.    @end
  119.  
  120.   @do money - `p21
  121.  
  122. //deposit.. we read from the file again so cheating won't be possible with
  123. //correct timing
  124.   @readfile tres2.dat
  125. `p20
  126.   @
  127.   @do `p20 + `p21
  128.   @do delete tres2.dat
  129.   @writefile tres2.dat
  130. `p20
  131.   @
  132.     @clearblock 21 24
  133. //if not owner, lets notify him
  134.  
  135. @readfile castle2.dat
  136. `p20
  137. `s01
  138. @
  139. ;load owner and current password
  140.  
  141. @if `p20 not &playernum then do
  142.   @begin
  143.    @writefile mail\mail`p20.dat
  144.   `0Castle Coldrake Reports:
  145. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  146. `0  `n`2 has deposited `$$`p21 `2to the treasury.
  147.  
  148.   @end
  149.  
  150.  
  151.     @do saybar
  152. `2You leave `$`p21`2 in the treasury.
  153.   @closescript
  154.  
  155.  
  156.   @end
  157.  
  158.  
  159. @#STABLES
  160. ;lets them warp to a view places
  161. @offmap
  162. @do moveback
  163. @show
  164. `r0`c  `r1  The Stables `r0
  165.  
  166.   `0"Greetings, s&sir!  Where can we drop you off today?" `2a smartly dressed
  167.   youth asks.
  168.  
  169. @do `v01 is 1
  170. @do write
  171. `x`x
  172. @choice
  173. Sosen Village
  174. Stonepass Lodge
  175. PortTown
  176. I'll stay here, thanks
  177. @if response not 4 then do
  178.   @begin
  179. @show
  180. `\`\  `0"We shall leave at once!" he shouts importantly.
  181.  
  182. `k  `2A few bumps later you arrive - ah, traveling in style is so much fun!
  183.  
  184.   `0"I bid you a goodday s&sir, please travel safely."
  185.  
  186.   `2Looks like you are on your own.
  187.  
  188. `k
  189. @if responce is 1 then do
  190.   @begin
  191.    ;Sosen village
  192.    @do x is 38
  193.    @do y is 5
  194.    @do map is 456
  195.   @end
  196.  
  197. @if responce is 2 then do
  198.   @begin
  199.    ;Stonepass Lodge
  200.    @do x is 40
  201.    @do y is 11
  202.    @do map is 880
  203.   @end
  204.  
  205. @if responce is 3 then do
  206.   @begin
  207.    ;Porttown
  208.    @do x is 43
  209.    @do y is 16
  210.    @do map is 956
  211.   @end
  212.  
  213.  
  214.   @loadmap &map
  215.   @end
  216. @drawmap
  217. @update
  218.  
  219. @#HEALME
  220. ;free heal
  221. @offmap
  222. @do moveback
  223. @show
  224. `r0`c  `r1  The Healers  `r0
  225.  
  226.   `2The good doctor looks you over for wounds carefully.
  227.  
  228.   `%YOU ARE COMPLETEY HEALED.
  229.  
  230. `k
  231. @do `p02 is `p03
  232. @drawmap
  233. @update
  234.  
  235.  
  236. @#TOWER
  237. ;Tower in the castle
  238. @DO SAYBAR
  239. `2The tower on this castle is not ready yet.
  240. @do moveback
  241.  
  242. @#doorguard
  243. @do moveback
  244. @label startg
  245. ;guy who owns on it pushes against the door guard symbol.  This lets him
  246. ;control the password to gain entrance to the castle, as well as sell it
  247. ;back or transfer ownership.
  248. @if castle2.dat exist false then do
  249.   @begin
  250.   @do saybar
  251. `0"You have 5 minutes to vacate this castle!" `2the guard barks.
  252.   @closescript
  253.   @end
  254.  
  255. @readfile castle2.dat
  256. `p20
  257. `s01
  258. @
  259. ;load owner and current password
  260.  
  261. @if `p20 not &playernum then do
  262.   @begin
  263.   @do saybar
  264. You wave to the door guard, nice of him to let you in.
  265.   @closescript
  266.   @end
  267. @busy
  268.  
  269.  
  270. @do `v01 is 1 ;set default choice to 1
  271. @show
  272. `r0`c  `r1 Instructing your servants `r0
  273.  
  274.   `2The huge doorguard snaps to attention when he sees you are going to
  275.   address him.
  276.  
  277. @do write
  278. `x`x
  279. @choice
  280. Set password to gain entrance (currently is `0`s01`%)
  281. Ownership options
  282. Leave
  283. @
  284. @if responce is 2 then do
  285.  @begin
  286.  @show
  287. `r0`c  `r1 Ownership Options `r0
  288.  
  289.   `2You retrieve your deed and carefully look it over.
  290.    
  291.    @do `v01 is 1
  292.    @do write
  293. `x`x
  294.    @choice
  295. Transfer deed to someone else
  296. Sell property back to the bank for `$10000`%.
  297. Do nothing of the sort
  298.  @if response is 1 then do
  299.    @begin
  300.    @show
  301. `\`\  `2Transfer to whom?
  302.    @chooseplayer `p20
  303.  
  304.    @if `p20 is 0 then do
  305.     @begin
  306.     @show
  307.   `2You decide to keep your domain - for now.`\`\`k
  308.     @do goto startg
  309.     @end
  310.    @do `s02 is getname `p20
  311.    @show
  312. `2  Are you sure you wish to give your castle to `0`s02`2?
  313. @do write
  314. `x`x
  315. @choice
  316. Yes
  317. Not on your life.
  318.  @if responce is 2 then do
  319.    @begin
  320.     @show
  321. `\`\  `2You decide to keep your domain - for now.`\`\`k
  322.     @do goto startg
  323.    @end
  324.  
  325.   @do delete castle2.dat
  326.   @writefile castle2.dat
  327. `p20
  328. `s01
  329. 0
  330. 0
  331. 0
  332. 0
  333.    @writefile mail\mail`p20.dat
  334.   `0Business note:
  335. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  336. `0  `n`2 has transferred ownership of Castle Coldrake to you. 
  337.   Password to enter will remain `0"`s01"`2 unless
  338.   `2you come by and change it.
  339.  
  340.     @do addlog
  341.   `0`n`2 has given `%Castle Coldrake`2 to `0`s02`2!
  342.      @routine seperate in gametxt.ref
  343.  
  344.     @show
  345. `\`\  `2Deed transfered.  Oh well - it was fun while it lasted.`\`\`k
  346.    @do goto done
  347.    @end
  348.   @if response is 2 then do
  349.     @begin
  350.     @show
  351. `\`\`2  Are you sure you wish to sell your castle back to the bank?`\
  352. @do `v01 is 1
  353. @do write
  354. `x`x
  355. @choice
  356. Yes
  357. Not on your life.
  358.  @if responce is 2 then do
  359.    @begin
  360.     @show
  361. `\`\  `2You decide to keep your domain - for now.`\`\`k
  362.     @do goto startg
  363.    @end
  364.  
  365.   @do delete castle2.dat
  366.   @do money + 10000
  367.   @show
  368. `\`\  `%CASTLE SOLD!`2`\`\`k
  369.     @do addlog
  370.   `0`n`2 has sold `%Castle Coldrake`2 back to the bank!
  371.     @routine seperate in gametxt.ref
  372.     @do goto done
  373.     @end
  374.  
  375.  
  376.   @do goto startg
  377.  @end
  378.  
  379. @if responce is 1 then do
  380.   @begin
  381.   @do write
  382. `\`\  `0"And the new password, s&sir?" `2(enter `4NONE`2 for no access to anyone)`\  `2Password:`x
  383.   @do readstring 40 `s01 `s01 
  384.   @do `p20 is length `s01
  385.   @if `p20 < 2 then do
  386.    @begin
  387.    @show
  388. `\`\  `2You decide the current password is ok.`\`\`k
  389.    @do goto startg
  390.    @end
  391.   @do delete castle2.dat
  392.   @writefile castle2.dat
  393. &playernum
  394. `s01
  395. 0
  396. 0
  397. 0
  398. 0
  399. @show
  400. `\`\  `0"Yes s&sir, I will not forget it!" `2the guard promises.`\`\`k
  401.    @do goto startg
  402.   @end
  403.  
  404. @drawmap
  405. @update
  406.  
  407. @#sign
  408. @do moveback
  409.  
  410.  @if castle2.dat exist false then do
  411.  @begin
  412.  @do saybar
  413. Castle Coldrake - For sale cheap, enquire inside.
  414.  @end 
  415.  
  416. @if castle2.dat exist true then do
  417.  @begin
  418. @readfile castle2.dat
  419. `p20
  420. `s01
  421. @
  422. @do `s01 is getname `p20
  423.  @do saybar
  424. `2Property of `0`s01`2.
  425.  @end 
  426.  
  427. @#enter
  428. @do moveback
  429. @offmap
  430. @if castle2.dat exist false then do
  431.   @begin
  432.   @show
  433. `r0`c  `r1 `%For Sale `r0
  434.  
  435.   `2Castle Coldrake was once a magnificient structure that housed many of
  436.   the royal families.
  437.  
  438.   Buy now and recieve the following bonuses:
  439.  
  440.   `0* `2A private carriage service!  With drop off points in `0Porttown`2
  441.     and `0Sosen Village`2!
  442.  
  443.   `0* `2Your very own physician on the grounds!
  444.  
  445.   `2The asking price is `$$20,000`2.
  446.  
  447. @do `v01 is 1
  448. @do write
  449. `x`x
  450. @choice
  451. >&money 19999 Purchase it.
  452. <&money 20000 Sigh wistfully and leave since you don't have enough.
  453. >&money 19999 Leave.
  454. @
  455.  
  456. @if responce is 1 then do
  457.   @begin
  458.   @if castle2.dat exist true then do
  459.     @begin
  460.     @show
  461. `\`\  `2Oh crap!  Someone bought it while you were thinking about it.  You
  462.   will regret your snail like thinking for the rest of your days.`\`\`k
  463.     @do goto done
  464.     @end
  465.  
  466.   @writefile castle2.dat
  467. &playernum
  468. NONE
  469. 0
  470. 0
  471. 0
  472. 0
  473.     @do money - 20000
  474.     @do addlog
  475.   `0`n `2buys `%Castle Coldrake`2!
  476.      @routine seperate in gametxt.ref
  477.  
  478.   @show
  479. `r0`c  `r1 `%Why hello there, landowner! `r0
  480. `\`2  Nice job!  You now own this castle!
  481.  
  482.   `2Enjoy your new home.`\`\`k
  483.   @end
  484.  
  485. @label done
  486. @drawmap
  487. @update
  488. @closescript
  489.   @end
  490.  
  491. @readfile castle2.dat
  492. `p20
  493. `s01
  494. @
  495.  
  496. @do `p21 is deleted `p20
  497.  
  498. @if `p21 is 1 then do
  499.   @begin
  500.    ;owner got deleted!!!  Lets put it up for sale again.
  501.    @do delete castle2.dat
  502.     @do addlog
  503.   `%Castle Coldrake`2 is put on the market today.
  504.      @routine seperate in gametxt.ref
  505.  
  506.    ;run script again
  507.    @do goto enter
  508.   @end
  509.  
  510. @if `p20 not &playernum then do
  511.   @begin
  512.   @do `s02 is getname `p20
  513.   @do upcase `s01
  514.   @if `s01 is NONE then do
  515.    @begin
  516.    @show
  517. `r0`c  `r1 None shall pass `r0
  518.  
  519.   `2You pound on the door for some time before you get an answer.
  520.  
  521.   `0"Master `s02`0 has declared that `4NO`0 visitors shall be allowed!" `2a
  522.   voice calls from behind the wall.
  523.  
  524.   `4Ouch!
  525.  
  526. `k
  527.    @do goto done
  528.    @end
  529.  
  530.   @show
  531. `r0`c  `r1 Stand and unfold thyself `r0
  532.  
  533. `2  A head pops over the gate.  `0"Halt, you!  What business have you with
  534.   my lord and master, `%`s02`0?" `2the door guard asks.
  535.  
  536. @do write
  537. `x`x
  538. @do `v01 is 1
  539. @choice
  540. Offer an explanation.
  541. Visit later.
  542.   @if response is 1 then do
  543.    @begin
  544.    @do write
  545. `\`\  `2Say what? :`x
  546.   @do readstring 40 NIL `s03 
  547.   @do upcase `s03
  548.   @do upcase `s01
  549.  
  550.   @if `s03 is `s01 then do
  551.     @begin
  552.     @show
  553. `\`\  `0"Welcome to `%Castle Coldrake`0,"`2 the guard smiles as he opens the gate.`\`\`k
  554.     @do goto letmein
  555.     @end
  556.    @writefile mail\mail`p20.dat
  557.   `0Castle Coldrake Reports:
  558. `2-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  559. `0  `n`2 attempted to sweet talk the guard by saying
  560.   `0"`s03"`2.  `2He was `bNOT`2 allowed in.
  561.  
  562.    @show
  563. `\`\  `2The guard doesn't look too interested.`\`\`k
  564.    @do goto done
  565.    @end
  566.  
  567.   @do goto done
  568.  
  569.   @end
  570.  
  571. ;let him in
  572. @label letmein
  573. @do x is 41
  574. @do y is 17
  575. @do map is 80
  576. @loadmap 80
  577. @do goto done
  578. @#done
  579.